package user

import (
	"news_for_deepseek_interface/controller"
	userDto "news_for_deepseek_interface/dto/admin/system/user"
	userService "news_for_deepseek_interface/service/admin/system/user"

	"github.com/gin-gonic/gin"
)

func IsSuperAdmin(c *gin.Context) {
	// 1. 参数绑定
	var params userDto.IsSuperAdminRequest
	if err := c.ShouldBindQuery(&params); err != nil {
		controller.Fail(c, controller.ParamsError, err.Error())
		return
	}

	adminId := c.GetInt("admin_id")

	// 3. 调用服务层处理
	response, err := userService.IsSuperAdmin(adminId)
	if err != nil {
		controller.Fail(c, controller.BusinessError, err.Error())
		return
	}

	controller.Success(c, response)
}
